<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
html {
	font-family: sans-serif;
	-ms-text-size-adjust: 100%;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 40px;
}

table {
	border-collapse: collapse;
	border-spacing: 0;
}

td, th {
	padding: 0;
}

.pure-table {
	border-collapse: collapse;
	border-spacing: 0;
	empty-cells: show;
	border: 1px solid #cbcbcb;
}

.pure-table caption {
	color: #000;
	font: italic 85%/1 arial, sans-serif;
	padding: 1em 0;
	text-align: center;
}

.pure-table td, .pure-table th {
	border-left: 1px solid #cbcbcb;
	border-width: 0 0 0 1px;
	font-size: inherit;
	margin: 0;
	overflow: visible;
	padding: .5em 1em;
}

.pure-table thead {
	background-color: #e0e0e0;
	color: #000;
	text-align: left;
	vertical-align: bottom;
}

.pure-table td {
	background-color: transparent;
}

.pure-table-bordered td {
	border-bottom: 1px solid #cbcbcb;
}

.pure-table-bordered tbody>tr:last-child>td {
	border-bottom-width: 0;
}
</style>
</head>
<body>
	<form action="${pageContext.request.contextPath}/QueryGoods2" method="post">
		商品名称：<input type="text" name="good_name" /> 商品类别:<select name="type_id">
			<option value="">请选择</option>
			<c:forEach var="item" items="${goodsList}">
				<option value="${item.type_id}">${item.type_name}</option>
			</c:forEach>
		</select> 商品状态:<select name="good_status">
			<option value="">请选择</option>
			<option value="0">下架</option>
			<option value="1">上架</option>
		</select> <input type="submit" value="查询" />
		<table class="pure-table pure-table-bordered">
			<thead>
				<tr>
					<th>编号</th>
					<th>商品名</th>
					<th>价格</th>
					<th>图片</th>
					<th>生产商</th>
					<th>类型</th>
					<th>数量</th>
					<th>状态</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach var="goods" items="${goodsList}">
					<tr>
						<td>${goods.good_id }</td>
						<td>${goods.good_name }</td>
						<td><fmt:formatNumber type="number" value="${goods.good_price}"
								pattern="0.00" maxFractionDigits="2" /></td>
						<td><img alt="" height="80" width="80"
							src="upload/${goods.good_picture}"> </img></td>
						<td>${goods.supplier }</td>
						<td>${goods.type_name }</td>
						<td>${goods.quantity }</td>
						<td><c:choose>
								<c:when test="${goods.good_status eq '0'}">
									已下架
    							</c:when>
								<c:otherwise>
									已上架
    							</c:otherwise>
							</c:choose></td>

					</tr>
				</c:forEach>
			</tbody>
		</table>

	</form>
</body>
</html>